package com.shuiyun.cloud.entity;
import lombok.Builder;
import lombok.Data;

/**
 * @author zhoujiwei
 * @create 2018/7/5 9:43
 * @desc
 **/
@Data
@Builder
public class Result<T> {

    private int code;

    private String message;

    private T data;

    public static Result success(String data) {
        return Result.builder()
                .code(0)
                .message("操作成功")
                .data(data)
                .build();
    }

    public static Result fail(String data) {
        return Result.builder()
                .code(-1)
                .message("操作失败")
                .data(data)
                .build();
    }
}
